'''
Created on Oct 21, 2009

@author: kage
'''
from PyBatch.handlers import base

class Mp4toMkv(base.MuxBase):
    def start(self, args=None):
        q = '"'
        self.__inputPath = args['inputPath'].replace('\\','/')
        self.__outputPath = args['outputPath'].replace('\\','/')
        self.__inputAudioLang = args['inputAudioLang']
        self.__title = args['title']
    
        # muxing command and arguements
        self.__command = q + self.mkvMergePath + q + " -o " + q + self.__outputPath + q
        self.__command += ' "--priority" "' + self.priority + '" "--default-track" "1:yes" "--forced-track" "1:no"'
        self.__command += ' "--language" "2:' + self.__inputAudioLang + '" "--default-track" "2:yes" "--forced-track" "2:no"'
        self.__command += ' "-a" "2" "-d" "1" "-S" "-T" "--no-global-tags" ' + q + self.__inputPath + q 
        self.__command += ' "--track-order" "0:1,0:2" "--title" "' + self.__title + '"'
        
        self.setCommandLine(self.__command)
        self.muxOperation()
